﻿using ERPSystem.Common.Domains.ReturnNotice;
using ERPSystem.Common.DTO;
using MediatR;
using SalesManagementWrite.API.SalesManagementWrites.PurchaseInvoicees;
using SqlSugar;

namespace SalesManagementWrite.API.SalesManagementWrites.ReturnNotices
{
    public class ReturnNoticeCreateCommon : IRequest<Result>
    {

        /// <summary>
        /// 退票通知单表主键编号
        /// </summary>
        public int ReturnNoticesId { get; set; }
        /// <summary>
        /// 退票通知单单据编号
        /// </summary>
        public string? ReturnNumber { get; set; }
        /// <summary>
        /// 业务类型
        /// </summary>
        public string? BusinessTypeId { get; set; }
        /// <summary>
        /// 仓库
        /// </summary>
        public string? Warehouseld { get; set; }
        /// <summary>
        /// 备注信息
        /// </summary>
        public string? Remark { get; set; }
        /// <summary>
        /// 单据日期
        /// </summary>
        public DateTime DocumentsDate { get; set; }
        /// <summary>
        /// 操作员
        /// </summary>
        public string? Operator { get; set; }
        /// <summary>
        /// 客户名称
        /// </summary>
        public string? ClientName { get; set; }
        /// <summary>
        /// 单据状态
        /// </summary>
        public string? Documentstatus { get; set; }
        /// <summary>
        /// 退货原因
        /// </summary>
        public string? ReturnReason { get; set; }
        /// <summary>
        /// 业务状态
        /// </summary>
        public string? BusinessstateId { get; set; }
        /// <summary>
        /// 处理方式
        /// </summary>
        public string? Processing { get; set; }
        /// <summary>
        /// 流水号
        /// </summary>
        public string? ThSerialnumber { get; set; }

        public List<RefundNoticeMaterialDTO> refundNoticeMaterials { get; set; }


        public class RefundNoticeMaterialDTO
        {
            /// <summary>
            /// 退票物料表主键编号
            /// </summary>
            public int ReturnmaterialId { get; set; }
            /// <summary>
            /// 销售单号
            /// </summary>
            public string? DocumentNumber { get; set; }
            /// <summary>
            /// 发货单号
            /// </summary>
            public string? DocumentNumbers { get; set; }
            /// <summary>
            /// 物料编码(外键 与物料表关联)
            /// </summary>
            public string? ItemBianma { get; set; }
            /// <summary>
            /// 物料名称
            /// </summary>
            public string? MaterialName { get; set; }
            /// <summary>
            /// 型号规格
            /// </summary>
            public string? Specifications { get; set; }
            /// <summary>
            /// 主计量
            /// </summary>
            public string? Measurenum { get; set; }
            /// <summary>
            /// 数量
            /// </summary>
            public int ReturnShulnum { get; set; }
            /// <summary>
            /// 入库数量
            /// </summary>
            public int BeginNumbere { get; set; }
            /// <summary>
            /// 批号
            /// </summary>
            public string? PiHao { get; set; }
            /// <summary>
            /// 备注
            /// </summary>
            public string? Remark { get; set; }
            /// <summary>
            /// 流水号
            /// </summary>
            public string? ThSerialnumber { get; set; }
        }
    }
}
